from ipywidgets import interact
import ipywidgets as widgets

def fun_2x(x):
    return 2*x

interact(fun_2x, x=1)